package com.umeox.watch.moto.dataservice.db.dao;


import android.database.Cursor;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;

import com.umeox.watch.moto.dataservice.db.model.HeartRate;

import java.util.List;

@Dao
public interface HeartRateDao {

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void save(HeartRate heartRate);

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void save(List<HeartRate> heartRates);

    @Delete
    int delete(HeartRate heartRate);

    @Delete
    void delete(List<HeartRate> heartRates);

    @Query("DELETE FROM heart_rate")
    void deleteAll();

    @Query("SELECT * FROM heart_rate")
    Cursor query();

    @Query("SELECT * FROM heart_rate WHERE measureTime=:measureTime")
    HeartRate query(long measureTime);
}
